% Test the function makeppft filter.
%
% Yoel Shkolnisky, December 2010.

explim=12;
for n=2.^(1:explim)
	precision='double';
	if n > 2^(explim-1)
		precision='single';
	end
    A=rand(n,n);
    tic;
    [ans1a ans1b]=PPFT2D(A,precision);
    t1 = toc;
    tic;
    [ans2a ans2b]=optimizedPPFT2D(A,precision);
    t2 = toc;
    ans3=optimizedAdjointPPFT2D(ans1a,ans1b,precision);
    ans4=optimizedAdjointPPFT2D(ans2a,ans2b,precision);
    fprintf(1,'n = %d, (t1-t2)/t1 = %d\n',n,(t1-t2)/t1);
    fprintf(1,'norm(ans1a-ans2a)/norm(ans1a) = %d\n',...
        norm(ans1a-ans2a)/norm(ans1a));
    fprintf(1,'norm(ans1b-ans2b)/norm(ans1b) = %d\n',...
        norm(ans1b-ans2b)/norm(ans1b));
    fprintf(1,'norm(ans3-ans4)/norm(ans3) = %d\n',...
        norm(ans3-ans4)/norm(ans3));
end




